package io;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;

public class ByteArrayOutputStreamDemo {

    public static void main(String[] args) throws Exception {
        // 内部缓存默认32的大小
        OutputStream out = new ByteArrayOutputStream();
        // 输出到缓冲区buff
        out.write("abc".getBytes());

        // 从缓冲区获取数据
        byte[] data = out.toString().getBytes();
        System.out.println(data);
        out.close();


    }
}
